



# 登录
from interface.member import MemberInterface
from utils.request_method import SendMethod


class AddressInterface:

    def __init__(self, headers):
        self.url = 'http://47.108.206.100:8085'
        self.headers = headers

    #添加收货地址
    def add_address(self, params):
        method = 'post'
        url = self.url + '/member/address/add'
        return SendMethod.send_method(method, url, json=params, headers=self.headers)


if __name__ == '__main__':
    body = {
        "username": "海绵宝宝",
        "password": '123456'
    }
    headers = MemberInterface().get_token_head(body)
    adderss={
            "city": "武汉",
            "defaultStatus": 0,
            "detailAddress": "长江大桥分期",
            "id": 2,
            "memberId": 2302,
            "name": "馒头",
            "phoneNumber": "13312345678",
            "postCode": "518000",
            "province": "湖北省",
            "region": "鹦鹉洲长江大桥"
    }
    ci=AddressInterface(headers)
    print(ci.add_address(adderss))



